﻿using System;
using Capture;
using System.Threading;
using Transport;
using Skynet.Contracts;
using Skynet.Contracts.Capture;
namespace Example
{
    class Program
    {
        static void Main(string[] args)
        {
            //// Kinect
            //using (var k = new KinectCapturer(new RawAudioTransport(null), new RawVideoTransport(null)))
            //{
            //    k.Initialize();
            //    k.Start();
            //    Thread.Sleep(new TimeSpan(0, 0, 13));
            //    k.Stop();
            //}

            // MME + DirectShow
            var dummyTransport = new DummyTransport();
            using (var m = new MmeCapturer(new RawAudioTransport(dummyTransport)))
            using (var d = new DirectShowCapturer(new RawVideoTransport(dummyTransport)))
            {
                m.Initialize();
                d.Initialize();
                m.Start();
                d.Start();
                Thread.Sleep(new TimeSpan(0, 0, 13));
                m.Stop();
                d.Stop();
            }
        }

        public class DummyTransport : ITransport
        {
            public void Transmit(FrameBase frame)
            {
                Console.WriteLine(frame.GetType().Name);
            }
        }
    }
}
